home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / pc / files / sat / msat09.tgz / FTL0.H < prev    next >
Text File  |  1994-09-17  |  3KB  |  138 lines

  1. /*
  2.     ftl0.h
  3.  
  4.     FTL0 header file defines
  5.  
  6.     John Melton
  7.     G0ORX, N6LYT
  8.  
  9.     4 Charlwoods Close
  10.     Copthorne
  11.     West Sussex
  12.     RH10 3QZ
  13.     England
  14.  
  15.     INTERNET:    g0orx@amsat.org
  16.             n6lyt@amsat.org
  17.             john@images.demon.co.uk
  18.             J.D.Melton@slh0613.icl.wins.co.uk
  19. */
  20.  
  21. #define PID_FILE    0xBB
  22. #define PID_DIRECTORY    0xBD
  23.  
  24. typedef struct
  25. {
  26.   char fFlag            __attribute__ ((packed));
  27.   unsigned fileId        __attribute__ ((packed));
  28.   char nFileType        __attribute__ ((packed));
  29.   unsigned short wOffset    __attribute__ ((packed));
  30.   unsigned char nOffsetHigh    __attribute__ ((packed));
  31. }
  32. FILEHEADER;
  33.  
  34. typedef struct
  35. {
  36.   char flags            __attribute__ ((packed));
  37.   unsigned fileId        __attribute__ ((packed));
  38.   unsigned offset        __attribute__ ((packed));
  39.   unsigned tOld            __attribute__ ((packed));
  40.   unsigned tNew            __attribute__ ((packed));
  41. }
  42. DIRHEADER;
  43.  
  44. #define VERSION      0
  45. #define VERSIONFLAG  0x0C
  46. #define LENGTHFLAG   0x01
  47. #define LASTBYTEFLAG 0x20
  48. #define OFFSETFLAG   0x02
  49.  
  50. #define PFHBROADCAST    0x00
  51. #define TYPEFLAG        0x03
  52. #define NEWESTFLAG    0x40
  53.  
  54. typedef struct
  55. {    
  56.     unsigned char flags        __attribute__ ((packed));
  57.     unsigned long fileId        __attribute__ ((packed));
  58.     short blockSize            __attribute__ ((packed));
  59. }
  60. REQUESTHEADER;
  61.  
  62. typedef struct
  63. {
  64.     unsigned short offset        __attribute__ ((packed));
  65.     unsigned char offset_msb    __attribute__ ((packed));
  66.     unsigned short length        __attribute__ ((packed));
  67. }
  68. HOLEPAIR;
  69.  
  70.  
  71. typedef struct
  72. {
  73.     unsigned startTime        __attribute__ ((packed));
  74.     unsigned endTime        __attribute__ ((packed));
  75. }
  76. DIRHOLEPAIR;
  77.  
  78. typedef struct
  79. {
  80.     unsigned char flags        __attribute__ ((packed));
  81.     short blockSize            __attribute__ ((packed));
  82. }
  83. DIRREQUESTHEADER;
  84.  
  85.  
  86. /*
  87.  *    connected protocols - UPLOAD only defined
  88.  */
  89.  
  90. typedef enum
  91. {
  92.     DATA,                /* 0 */
  93.     DATA_END,
  94.     LOGIN_RESP,
  95.     UPLOAD_CMD,
  96.     UL_GO_RESP,
  97.     UL_ERROR_RESP,            /* 5 */
  98.     UL_ACK_RESP,
  99.     UL_NAK_RESP            /* 7 */
  100. }
  101. PACKET_TYPE;
  102.  
  103. typedef enum
  104. {
  105.     ER_NONE,            /* 0 */
  106.     ER_ILL_FORMED_CMD,
  107.     ER_BAD_CONTINUE,
  108.     ER_SERVER_FSYS,
  109.     ER_NO_SUCH_FILE_NUMBER,
  110.     ER_SELECTION_EMPTY_1,        /* 5 */
  111.     ER_MANDATORY_FIELD_MISSING,
  112.     ER_NO_PFH,
  113.     ER_POORLY_FORMED_SEL,
  114.     ER_ALREADY_LOCKED,
  115.     ER_NO_SUCH_DESTINATION,        /* 10 */
  116.     ER_SELECTION_EMPTY_2,
  117.     ER_FILE_COMPLETE,
  118.     ER_NO_ROOM,
  119.     ER_BAD_HEADER,
  120.     ER_HEADER_CHECK,        /* 15 */
  121.     ER_BODY_CHECK            /* 16 */
  122. }
  123. ERROR_CODES;
  124.  
  125. typedef struct
  126. {
  127.     unsigned long file;
  128.     unsigned long length;
  129. }
  130. UPLOAD_REQUEST;
  131.  
  132. typedef struct
  133. {
  134.     unsigned long file;
  135.     unsigned long offset;
  136. }
  137. UPLOAD_RESPONSE;
  138.